package com.tjf.lib_core.upload;


import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.tjf.lib_core.R;


public final class TipDialog {

    public static final class Builder
            extends BaseDialog.Builder<Builder> {

        private final TextView tv_cancel;
        private final TextView tv_ok;

        public Builder(Context context) {
            this(context, null, null);
        }

        public Builder(Context context, String title, String msg) {
            super(context);
            setContentView(R.layout.logout_dialog);
            setAnimStyle(BaseDialog.ANIM_BOTTOM);
            setCancelable(false);
            TextView tv_title = findViewById(R.id.tv_title);
            TextView tv_msg = findViewById(R.id.tv_msg);
            if (!TextUtils.isEmpty(title)) {
                tv_title.setText(title);
            }
            if (!TextUtils.isEmpty(msg)) {
                tv_msg.setText(msg);
            }

            tv_cancel = findViewById(R.id.tv_cancel);
            tv_ok = findViewById(R.id.tv_ok);
            setOnClickListener(tv_cancel, tv_ok);

            tv_cancel.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    dismiss();
                }
            });
            tv_ok.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {

                }
            });
        }


        public TextView getTv_ok() {
            return tv_ok;
        }
    }
}